home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
How Would You Survive?
/
How Would You Survive (1995)(Grolier)[Mac-PC].iso
/
pc
/
shared.dir
/
01984_Script_aRandomQuestion
< prev
next >
Wrap
Text File
|
1995-09-13
|
8KB
|
247 lines
property pSprite,pHotSprite,plocationV,plocationH,pNoOfQuestions,pFunction1,¼
pFunction2,pFunction4,pFunction3,pMylist,pCast,pCast2,¼
pCast3,pCast4,pCast5,pBeenClicked,pQuestion1,pQuestion2,¼
pQuestion3,pQuestion4,pDestination,x,pTheQuestion,¼
pPeriodicTask,pQuestionArt,pThelists,EgyptList,AztecList,¼
VikingList,phelpStatus,pMySound
global gQuestCount, gTheHelpIsOn
on birth me, thesprite,theHotSprite,theCast,locationV,locationH,Question1Cast,¼
NumberofQuestions,theFunction1,theFunction2,theFunction3,¼
theFunction4,theQuestionList,aSound
set EgyptList = [1501:1, 1502:1, 1503:1, 1504:1, 1505:1, 1506:1, 1507:1, 1508:1, 1509:1, ¼
1510:1, 1511:1, 1512:1, 1513:1, 1514:1, 1515:1, 1516:1, 1517:1, 1518:1,¼
1519:1, 1520:1, 1521:1, 1522:1, 1523:1, 1524:1, 1525:1, 1526:1, 1527:1,¼
1528:1, 1529:1, 1530:1, 1531:1, 1532:1 ]
set AztecList = [ 1501:1, 1502:1, 1503:1, 1504:1, 1505:1, 1506:1, 1507:1, 1508:1, 1509:1, ¼
1510:1, 1511:1, 1512:1, 1513:1, 1514:1, 1515:1, 1516:1, 1517:1, 1518:1,¼
1519:1, 1520:1, 1521:1, 1522:1, 1523:1, 1524:1, 1525:1, 1526:1, 1527:1, 1528:1]
set VikingList = [1501:1, 1502:1, 1503:1, 1504:1, 1505:1, 1506:1, 1507:1, 1508:1, 1509:1, ¼
1510:1, 1511:1, 1512:1,¼
1513:1, 1514:1, 1515:1, 1516:1, 1517:1, 1518:1, 1519:1, 1520:1, 1521:1,¼
1522:1, 1523:1, 1524:1, 1525:1, 1526:1, 1527:1, 1528:1, 1529:1, 1530:1,¼
1531:1, 1532:1, 1533:1, 1534:1, 1535:1, 1536:1, 1537:1, 1538:1]
set pPeriodicTask = FALSE
set pSprite = theSprite
set pCast = theCast
set pCast2 = pCast + 1
set pCast3 = pCast + 2
set pCast4 = pCast + 3
set pCast5 = pCast + 4
set pQuestion1 = Question1Cast
set pQuestion2 = pQuestion1 + 1
set pQuestion3 = pQuestion1 + 2
set pQuestion4 = pQuestion1 + 3
set pHotSprite = theHotSprite
set plocationV = locationV
set plocationH = locationH
set pNoOfQuestions = NumberofQuestions
set pFunction1 = theFunction1
set pFunction2 = theFunction2
set pFunction3 = theFunction3
set pFunction4 = theFunction4
set pQuestionList = theQuestionList
set pThelists = [EgyptList, AztecList, VikingList]
set pMylist = getat(pThelists, pQuestionList)
set pMySound = aSound
set phelpStatus = 0
puppetSprite pSprite, TRUE
set the castNum of sprite pSprite = pCast
return me
end
on SwitchList me, NewQuestionList
set pQuestionList = NewQuestionList
set pMylist = getat(pThelists, pQuestionList)
end
on InitQuestions me, NewLocationV,NewLocationH,NewQuestion1Cast,NewNumberofQuestions,¼
theNewFunction1,theNewFunction2,theNewFunction3,theNewFunction4
set plocationV = NewLocationV
set plocationH = NewLocationH
set pQuestion1 = NewQuestion1Cast
set pQuestion2 = pQuestion1 + 1
set pQuestion3 = pQuestion1 + 2
set pQuestion4 = pQuestion1 + 3
set pNoOfQuestions = NewNumberofQuestions
set pFunction1 = theNewFunction1
set pFunction2 = theNewFunction2
set pFunction3 = theNewFunction3
set pFunction4 = theNewFunction4
end
on InitQuestLocs me, NewLocationV,NewLocationH
set plocationV = NewLocationV
set plocationH = NewLocationH
end
on RandomQuestion me
if (pPeriodicTask = FALSE) then
set ShouldIAsk = random(160)
if ShouldIAsk = 20 then
if soundbusy(3) = false then
set pbeenclicked = false
puppetsprite psprite, true
set ChooseQuestion = random(pNoOfQuestions)
if ChooseQuestion = 1 then
set x = getaProp(pMylist, pQuestion1)
set pDestination = pFunction1
set pTheQuestion = pQuestion1
else
if ChooseQuestion = 2 then
set x = getAProp(pMylist, pQuestion2)
set pDestination = pFunction2
set pTheQuestion = pQuestion2
else
if ChooseQuestion = 3 then
set x = getAProp(pMylist, pQuestion3)
set pDestination = pFunction3
set pTheQuestion = pQuestion3
else
if ChooseQuestion = 4 then
set x = getAProp(pMylist, pQuestion4)
set pDestination = pFunction4
set pTheQuestion = pQuestion4
end if
end if
end if
end if
if x = 1 then
set the locV of sprite pSprite = plocationV
set the locH of sprite pSprite = plocationH
updatestage
wait .3
set the castnum of sprite pSprite = pCast2
updatestage
wait .3
set the castnum of sprite pSprite = pCast3
updatestage
wait .3
set the castnum of sprite pSprite = pCast4
updatestage
wait .3
set pPeriodicTask = TRUE
set gQuestCount = 0
set pQuestionArt = pTheQuestion
startTimer
end if
end if
else
nothing
end if
end if
end
on doPeriodicTask me
return (pPeriodicTask)
end
on flashQuestion me
set holdCast = the castNum of sprite pSprite
if (holdCast = pCast4) then
set the castnum of sprite pSprite = pCast5
set gQuestCount = gQuestCount + 1
updatestage
else
set the castnum of sprite pSprite = pCast4
set gQuestCount = gQuestCount + 1
updatestage
end if
end
on displayQuestionArt me
--if (not(pPeriodicTask)) then return FALSE
set pPeriodicTask = FALSE
set gQuestCount = 0
set hotspotactive = 1
set the castnum of sprite pSprite = pTheQuestion
puppetSprite pHotSprite, TRUE
set the locH of sprite pHotSprite = plocationH
set the locV of sprite pHotSprite = plocationV
updatestage
repeat while hotspotactive = 1
ArrowCursor
if rollover (pHotSprite) then
repeat while rollover (pHotSprite)
HandCursor
if (the mouseDown) then
resetQuestionMark me
setAProp pMylist, pTheQuestion, 0
set hotspotactive = 0
do pDestination
return false
end if
end repeat
else
if (the mouseDown) then
resetQuestionMark me
set hotspotactive = 0
return false
end if
end if
end repeat
end
on resetQuestionMark me
set the locH of sprite psprite = -200
set the locH of sprite photsprite = -200
set the castnum of sprite psprite = pCast
puppetsprite pHotSprite, false
updatestage
set gQuestCount = 0
set pBeenClicked = false
set pPeriodicTask = FALSE
end
on hideControl me
puppetSprite pSprite, FALSE
end
on TurnOnHelpSound me
set phelpStatus = 1
end
on TurnOffHelpSound me
set phelpStatus = 0
end
on setNewSound me, aNewSound
set pMySound = aNewSound
end
on DoTheFunction me
do pDestination
end
on RolloverJob me
set checkVoiceover = 0
if the mousecast = the castnum of sprite 44 then
repeat while rollover(44)
HANDCURSOR
if checkVoiceover = 0 then
if gTheHelpIsOn = 1 then
puppetsound pMySound
updatestage
set checkVoiceover = 1
end if
end if
if the mousedown then
set pbeenclicked = 1
else
if pbeenclicked = 1 then
getQuestion
end if
end if
end repeat
end if
end
on CheckClickedStatus me
return pbeenclicked
end